'use strict';
angular.module('myApp.custom', ['ngRoute'])
    .config(['$routeProvider', function($routeProvider) {
        $routeProvider.when('/view', {
            templateUrl: 'view/custom/view.html',
            controller: 'ViewCtrl'
        });
    }])
    .controller('ViewCtrl', function($scope, $http) {
        $http.get("php/Demo.php")
            .then(function successCallback(response) {
                $scope.names = response.data;
            });
    }).directive("hover",function(){
        return{
            restrict:'AE',
            link:function(scope,element,attrs){
                element.bind("mouseenter",function(event){
                    element.css({'background':'#333',"color":"#fff"});
                });
                element.bind("mouseleave",function(event){
                    element.css({'background':'#eee',"color":"#333"});
                });
            }
        }
    });
